<template>
  <view class="my-settle-container">
      <label class="radio" @click="changeAllState">
        <radio :checked="isFullCheck"  color="#c00000" /><text>全选</text>
      </label>
      <view class="amount-box">
         合计: <text class="price">￥{{ checkedGoodsAmount }}</text>
      </view>
      <view class="btn-settle">
          结算({{checkedCount}})
      </view>
  </view>
</template>

<script>
  import {mapGetters, mapMutations} from 'vuex';
  export default {
    name:"my-settle",
    data() {
      return {
        
      };
    },
    computed:{
       ...mapGetters('m_cart', ['checkedCount','total','checkedGoodsAmount']),
       // 是否全选
       isFullCheck () {
          return this.total  == this.checkedCount;
       }
    },
    methods:{
      ...mapMutations('m_cart',['updateAllGoodsState']),
      changeAllState () {
          this.updateAllGoodsState(!this.isFullCheck);
      }
    }
  }
</script>

<style lang="scss">
.my-settle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 3px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #fff;
    border-top: 1px solid #efefef;
    .amount-box {
      .price {
        color: #c00000;
      }
    }
    .btn-settle {
      min-width: 100px;
      background-color: #c00000;
      height: 50px;
      line-height: 50px;
      color: #fff;
      text-align: center;
    }
}
</style>